import React, { Component } from 'react'
import {Route, NavLink } from 'react-router-dom'
import Detail from '../Detail'

export default class index extends Component {
  render() {
    return (
      <div>
        <ul>
          <li>
            <NavLink to="/home/message/1">message001</NavLink>
          </li>
          <li>
            <NavLink to="/home/message/2">message002</NavLink>
          </li>
          <li>
            <NavLink to="/home/message/3">message003</NavLink>
          </li>
        </ul>
        <button
          onClick={() => {
            this.props.history.push("/");
            console.log(this.props.history);
          }}
        >
          主页
        </button>
        <button
          onClick={() => {
            this.props.history.replace("/home/message/3");
            // console.log(this.props.history);
          }}
        >
          替换
        </button>
        {/* <Detail></Detail> */}
        <Route path="/home/message/:id" component={Detail}></Route>
      </div>
    );
  }
}
